html {
  height: 100%;
}
body {
  margin: 0;
  padding: 0 0 100px;
  display: flex;
  gap: 20px;
  justify-content: center;
  background-color: aliceblue;
}
.section {
  display: flex;
  .content-check:checked + .content {
    max-height: fit-content;
    .btn {
      left: auto;
      right: calc(50% - 50px);
      &::after {
        transform: scaleY(-1);
      }
    }
    .text {
      mask: none;
    }
  }
  .content {
    width: 400px;
    max-height: 200px;
    overflow: hidden;
    border-radius: 4px;
    outline: 2px dashed royalblue;
    &::before {
      content: "";
      width: 100px;
      height: 100%;
      float: left;
    }
    pre {
      white-space: pre-wrap;
    }
    .text {
      box-sizing: border-box;
      width: 100%;
      padding: 10px 15px;
      float: right;
      line-height: 1.5;
      margin: 0;
      margin-left: -100px;
      font-size: 18px;
      color: #232323;
      mask: linear-gradient(red 150px, transparent 200px);
    }
    .btn {
      float: right;
      width: 100px;
      text-align: center;
      position: relative;
      left: calc(50% - 50px);
      transform: translateY(-100%);
      cursor: pointer;
      &::before,
      &::after {
        content: "";
        height: 34px;
      }
      &::before {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
      }
      &::after {
        display: block;
        background-color: #666;
        transition: background-color 0.2s;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E %3Cpath d='M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z'%3E%3C/path%3E %3C/svg%3E")
          center / 24px 24px no-repeat;
      }
      &:hover::after {
        background-color: royalblue;
      }
    }
  }
}
